@import "../style/globals.scss";

#beta {
  background: repeating-linear-gradient(45deg,
      #9b9a4e,
      #9b9a4e 10px,
      #6e6a33 10px,
      #6e6a33 20px);
  background-color: "#c63131";
  text-align: center;
  color: white;
  text-shadow: 0px 2px 4px black;
  padding: 4px;
  padding-bottom: 6px;
}

#doc-layout {
  display: flex;
  flex-direction: row;
}

#handbook-content {
  margin: auto;
  padding: 0 2rem;
  max-width: 1200px;
  min-width: 0;

  @media (max-width: $screen-xs) {
    padding: 0;
  }

  // Page title
  &>h1 {
    font-size: 3.5rem;
    line-height: 3.5rem;
    font-weight: 400;
    letter-spacing: 0rem;

    @media (max-width: $screen-sm) {
      margin-left: 1rem;
      margin-right: 1rem;
      font-size: 2.5rem;
    }
  }

  article {
    display: flex;
    flex-direction: row;
    width: 100%;

    aside.handbook-toc {
      @media (max-width: $screen-xs) {
        padding: 0 0.5rem;
        box-sizing: border-box;
      }
    }

    .whitespace.raised {
      width: fill-available;
      width: -moz-available;
      width: -webkit-fill-available;
    }

    @media (max-width: 999px) {
      flex-direction: column;
    }
  }

  .whitespace,
  .whitespace-tight {
    margin: 1rem auto;
    margin-top: 0;
    padding: 2rem;
    overflow: hidden;

    @media (max-width: 999px) {
      order: 2;
    }
  }

  .whitespace-tight {
    padding: 1.2rem 2rem;
  }

  aside {
    width: 13rem;
    flex-shrink: 0;
    margin-left: 20px;

    @media (min-width: 1000px) {
      display: block;
    }
    @media (max-width: 999px) {
      position: relative;
      top: 0;
      width: 100%;
      z-index: 98;
      margin-left: 0;
      order: 1;
    }
    nav {
      position: sticky;
      top: 30px;

      &.deprecated {
        top: 7rem;
      }

      margin-bottom: 1rem;
    }

    h5 {
      font-weight: 600;
      font-size: 16px;
      margin: 0;
    }

    ul {
      padding: 0;

      li {
        list-style: none;
      }

      a {
        font-weight: normal;
        font-size: 14px;
        color: var(--alt-text-color);

        text-decoration: none;
        border-left: 2px solid transparent;
        padding-left: 8px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        display: block;

        &:hover,
        &:active {
          border-left: 2px solid rgba(0, 120, 212, 0.3);
        }

        &.current {
          border-left: 2px solid #0078d4;
        }
      }
    }

    .like-dislike-subnav {

      #like-button,
      #dislike-button {
        cursor: pointer;
      }
    }
  }

  .preamble a {
    color: var(--text-color);
  }

  .justify-between {
    justify-content: space-between;
  }

  a.navigation-link {
    text-decoration: none;
    flex: 1;
  }

  .prev-next {
    flex: 1;

    .arrow {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      margin-right: 20px;
    }

    header,
    h3,
    p {
      padding: 0;
      margin: 0;
    }

    header {
      margin-bottom: 0.5rem;
      font-size: 0.8rem;
    }

    p {
      margin-bottom: 0.4rem;
    }

    p,
    header {
      color: var(--text-color);
    }

    &:hover svg path,
    &:hover h3 {
      fill: var(--text-color);
      color: var(--text-color);
    }

    .nav-content {
      flex: 1;
      padding-right: 1rem;
    }

    &.next {
      flex-direction: row-reverse;
      text-align: right;

      padding-right: 0;
      padding-left: 1rem;

      .arrow {
        margin-right: 0px;
        margin-left: 20px;
      }

      svg {
        transform: scaleX(-1);
      }
    }
  }

  .vertical-line {
    height: 80px;
    background-color: #e3e3e3;
    min-width: 2px;
    flex-basis: 2px;
    flex-grow: 0;
    flex-shrink: 0;
  }

  .docs-footer {
    height: 2rem;
    margin: 0 -2rem;
    padding: 0 0;
    border-top: var(--border-color) 1px solid;
    display: flex;
    flex-direction: row-reverse;

    h5 {
      margin: 0;
      padding: 0;
      padding-top: 0.5rem;
      padding-right: 1rem;
      font-weight: normal;
    }

    button {
      border: none;
      background: none;
      display: inline-flex;
      flex-direction: row;
      align-items: center;
      color: var(--text-color);
      border-left: 1px solid var(--border-color);
      padding: 0 1rem;
      cursor: pointer;

      &:hover {
        background-color: var(--border-color);
      }

      svg {
        margin-right: 4px;
        fill: var(--text-color);
        color: var(--text-color);
      }
    }
  }

  #deprecated-header {
    color: black;
    background-color: #fff4cf;
    margin: 0 -2rem;
    padding: 1rem 2rem 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;

    [id]::before {
      height: 110px;
      margin-top: -110px;
    }

    @media (max-width: $screen-sm) {
      margin: 0 0 0 0;
      padding: 1rem;
      flex-direction: column;

      h3 {
        font-size: 0.8rem;
      }

      #deprecated-icon {
        margin-right: 1rem;
      }

      #deprecated-action {
        margin-top: 1rem;
      }
    }

    #deprecated-content {
      display: flex;
      align-items: center;

      #deprecated-icon {
        width: 2rem;
        text-align: center;
      }
    }

    h3 {
      margin-top: 0;
      font-weight: normal;
      font-size: 1.5rem;
      margin-bottom: 0.5rem;
    }

    p {
      margin-top: 0;
      margin-bottom: 0.2rem;
    }

    #deprecated-action {
      flex-shrink: 0;

      a {
        padding: 0.2rem 0.5rem;
        background-color: white;
        border: 1px solid black;
        text-decoration: none;
        color: black;

        &:hover {
          background-color: #eee;
        }
      }
    }
  }

  .markdown table.cli-option {
    display: table;

    tr {
      width: 100%;

      p {
        margin: 0;
        padding: 0;
      }

      code {
        word-wrap: normal;
      }
    }

    // Override the default stripes
    tr.odd {
      background-color: var(--background-color) !important;
    }

    tr.even {
      background-color: var(--background-minor-highlight-color) !important;
    }

    ul {
      margin: 0;
      padding: 0;

      li {
        list-style: none;
        margin: 0;
        margin-bottom: 8px;
      }
    }

    tr.option-description td {
      margin-top: 0;
      border-top: none;
    }
  }
}

.circle-bg {
  background-color: #719af4;
  color: black;
  width: 32px;
  height: 32px;
  line-height: 31px;
  border-radius: 16px;
  text-align: center;
  display: inline-block;
  position: relative;
  overflow: hidden;
  margin-top: 12px;
  margin-right: 3px;

  img {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 16px;
    width: 32px;
    height: 32px;
  }
}

.bottom-section-content {
  flex: 1;
  padding: 1rem 2rem;
}

.small-columns {
  @media (max-width: $screen-xs) {
    flex-direction: column !important;
  }
}

.inline-popup {
  background: var(--background-color);
  position: absolute;
  z-index: 110;
  box-shadow: 0 30px 90px -20px rgb(0 0 0 / 30%), 0 0 1px 1px rgb(0 0 0 / 5%);
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  min-width: 300px;
  max-width: 400px;
  border-radius: 2px;
  transition: opacity 0.5s;

  .inline-popup-container {
    display: flex;

    a.inline-popup-extract {
      max-height: 140px;
      overflow: hidden;
      margin: 16px;
      display: block;
      color: var(--text-color);
      text-decoration: none;
      position: relative;

      h5 {
        margin-top: 0;
      }

      &::after {
        content: " ";
        position: absolute;
        bottom: 0;
        width: 25%;
        height: 20px;
        background-color: transparent;
        pointer-events: none;
      }

      div {
        margin: 0;

        code {
          background-color: var(--inline-code-background-color);
          border-radius: 2px;
          padding: 2px 4px;
        }
      }
    }
  }

  &.popup-fade-in {
    -webkit-animation: 0.1s ease forwards;
    animation: 0.1s ease forwards;
  }
}

.handbook-on-this-page-section-list {
  overflow: auto;
  max-height: 80vh;
  ul {
    padding-left: .5em !important;
  }
}
